let formValidate = {
  data(){
    let numberValidator = (rule,value,callback) => {
      if(value===''){
        return callback(new Error(this.$t('m.choose')))
      } else if(isNaN(value)){
        return callback(new Error(this.$t('m.check.format')))
      } else if(value<0){
        return callback(new Error(this.$t('m.enter')+this.$t('m.check.number0')))
      }
      callback()
    }
    return {
      ruleForm:{
        maxStock:[{ validator:numberValidator, trigger:'blur' }],
        minStock:[{ validator:numberValidator, trigger:'blur' }]
      }
    }
  }
}
export {formValidate}